# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-fitfile
_pkgorig=fitfile
pkgver=1.1.7
pkgrel=1
pkgdesc="Decode/parse Garmin's FIT format files"
url="https://github.com/tcgoetz/Fit"
arch="noarch"
license="GPL-2.0-or-later"
depends="python3"
checkdepends="
	py3-pytest-xdist
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/f/fitfile/fitfile-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer --destdir="$pkgdir" .dist/*.whl
}

sha512sums="
264844a1443c46137f1679c8b269577a72c7bd58d4fee94b2199b13622c9a22c0288277a6157e34eca919a40fdc7193165ad11bc73704bbba58b35d330601d8b  py3-fitfile-1.1.7.tar.gz
"
